package com.supermap.dubbo.api.advisoryinfo;

import com.supermap.dataservice.util.JSONUtil;
import com.supermap.dataservice.util.Table;
import com.supermap.dubbo.api.advisoryinfo.entity.AdvComment;
import com.supermap.dubbo.api.advisoryinfo.entity.Advisoryinfo;
import com.supermap.dubbo.api.advisoryinfo.entity.Advpraise;
import org.apache.ibatis.annotations.Param;


/**
 * @Author:langhongshuai
 * @Description:
 * @Date:18/1/29 上午9:36
 */
public interface AdvisoryinfoService {

    /**
     * 获得咨询信息
     * @return
     */
    public JSONUtil getAdvisoryInfoByUIdArea(String userId, String areaCode);

    /**
     * 上传咨询
     */
    public JSONUtil addAdvisory(Advisoryinfo advisoryinfo);

    /**
     * 查询所有咨询
     * @return
     */
    JSONUtil  getAdvisoryInfo();

    /**
     * 根据咨询ID 得到对应的点赞数
     * @param advInfoId
     * @return
     */
    int getAdvpraiseCount(int advInfoId);

    /**
     *判断是否点过赞
     * @param userId
     * @param advInfoId
     * @return
     */
    boolean getAdvpraise(int userId, int advInfoId);

    /**
     *点击赞 增加一条数据
     * @param advpraise
     * @return
     */
    boolean addAdvpraise(@Param("advpraise") Advpraise advpraise);

    /**
     * 添加评论
     * @param advComment
     * @return
     */
    boolean addAdvcomment(AdvComment advComment, String uid);

    /**
     * 根据咨询ID得到对应所有的评论（树形结构展示）
     * @return
     */
    JSONUtil getAdvCommentListByAdvInfoId(int advInfoId);

    /**
     * 删除咨询
     * @param advId
     * @return
     */
    JSONUtil delAdvisoryInfo(int advId);

    /**
     * 根据areacode和subjectid查出 咨询
     * @param areacode
     * @param subjectid
     * @return
     */
    JSONUtil  getAdvinfoByAreacodeandCropid(String areacode, String subjectid);

    /**
     * 根据userId咨询 点赞 评论返回前端的信息
     * @param userId
     * @param areaCode
     * @return
     */
    JSONUtil getAdvAllInfoByUserIdorAreaCode(Table table, String userId,String areaCode,String subjectId,String expertId);

    /**
     * 根据userId和subjectid查询相关咨询
     * @param userId
     * @param subjectid
     * @return
     */
    JSONUtil getAdvByuserIdAndSubject(String userId,String subjectid);

}
